package com.s2u2m.training.ex_programmer.liskov_substitution.good;

import com.s2u2m.training.ex_programmer.liskov_substitution.Shape;

import java.security.InvalidParameterException;


public class Rectangle implements Shape {
    @Override
    public Double area(Double length, Double width)
            throws InvalidParameterException {
        if (length < 0 || width < 0) {
            throw new InvalidParameterException();
        }

        return length * width;
    }


}
